Component({
    properties: {
        logoChar: {
            type: String,
            observer: function(e, t) {
                var o = this;
                e ? this.drawLogo().then(function(e) {
                    o.triggerEvent("logo", {
                        value: e
                    });
                }) : this.triggerEvent("logo", {
                    value: "/images/default/logo.png"
                });
            }
        }
    },
    methods: {
        drawLogo: function() {
            var e = this, t = this.data.logoChar, o = wx.createCanvasContext("logo", this);
            return o.setFillStyle("#50c750"), o.fillRect(0, 0, 100, 100), o.setFillStyle("white"), 
            o.setFontSize(46), o.setTextBaseline("middle"), o.setTextAlign("center"), o.fillText(t, 50, 50), 
            o.draw(), new Promise(function(t, o) {
                setTimeout(function() {
                    wx.canvasToTempFilePath({
                        canvasId: "logo",
                        success: function(e) {
                            var o = e.tempFilePath;
                            t(o);
                        },
                        fail: function(e) {
                            console.error("Error in drawLogo in logo-creator.js: ", e), o(e);
                        }
                    }, e);
                }, 200);
            });
        }
    }
});